package com.wavercaz.freeforum.pojo.vo;

import com.wavercaz.freeforum.pojo.Post;
import com.wavercaz.freeforum.pojo.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class ReportVo {
    private Integer id;
    private UserInfo userInfo;
    private Post post;
    private Integer reason;
    private Integer status;
    private String description;
    private LocalDateTime createDate;

    public String getCreateDate() {
        return createDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }

    public void setCreateDate(String createDateDateString) {
        this.createDate = LocalDateTime.parse(createDateDateString,DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }
}
